package cn.gdsdxy.dao;

import cn.gdsdxy.pojo.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface GoodsMapper {
    @Select("select * from a_index where type='home'")
    List<Goods> getAllGoods();

    @Select("select * from a_index where type='phone'")
    List<Goods> getphoneGoods();

    @Select("select * from a_index where type='蓝牙耳机'")
    List<Goods> getairposGoods();

    @Select("select * from a_index where type='平板电脑'")
    List<Goods> getpadGoods();

    @Select("select * from a_index where type='电脑'")
    List<Goods> getmacGoods();

    @Select("select * from a_index where id =#{id}")
    Goods getidGoods(int id);

    @Select("select * from a_index where title like '%${title}%'")
    List<Goods> gettitleGoods(String title);
}
